<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/table.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

<script type="text/javascript">
  function savaholiday(){
  var startTime=$("#startTime").val();
  var endTime=$("#endTime").val()
  var text=$("#text").val();
   var state=$("#state").val();
	if(endTime!=''){
		if(startTime==''||startTime=='null'){
			alert("填写开始时间");
			return;
		}
	}
	if(startTime==''||startTime==null)
	{
		alert("请选择节假日日期");
	}
    
    if($.trim(state)==''||$.trim(state)==null){
	$("#errorinfo").html("<img src=\"image/cuo.gif\" width=\"16\" height=\"16\"/>&nbsp;<font color=\"#FF0000\">不能为空！</font>");
			return;
	 }else{
			$("#errorinfo").html("");
	 };
     if(text.length>200){
       alert("不能超过两百字符");
       return; 
     };
     var param={"startTime":startTime,"endTime":endTime,"oattendanceHoliday.note":text,"state":state}
     $.post("savaHoliday.action",param,function(data){
     if(data=="success"){
       window.close();
       window.opener.location.href="getHolidayList.action";
	   
     }else{
      alert("添加失败");
     }
     });
     
}
</script>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td>个人办公 &gt; 考勤管理 &gt; 节假日设定 &gt; <a href="addHoliday.action">添加</a></td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>
<table style="margin: 10px 10px 10px 10px "  align="center">
<tr><td>节假日</td><td><input style="margin: 10px 0 0 0" name="startTime"
			value="${startDate }" class="Wdate" id="startTime" type="text"
			readonly="readonly"
			onclick="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\',{d:-0});}'})"
			id="startTime" />
			至
			<input style="margin: 10px 0 0 0" name="endTime" value="${endDate}"
			class="Wdate" id="endTime" type="text" readonly="readonly"
			onclick="WdatePicker({minDate:'#F{$dp.$D(\'startTime\',{d:0});}'})"
			id="endTime" /></td></tr>
<tr><td>假日说明</td><td><input id="state" type="text" maxlength="10" width="100px" height="30px"/>&nbsp;&nbsp;<span id="errorinfo"></span></td></tr>
<tr><td>备注</td><td><textarea id="text" name="note" style=" width:250px; height:150px; overflow:hidden" ></textarea></td></tr>

<tr><td><input type="submit" class="button_02" value="添加" onclick="savaholiday()" />&nbsp;&nbsp;

</td></tr>
</table>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
</body>
</html>